package day02;


public class DataTypeDemo {
    public static void main(String[] args){
        byte b1 = 5;
        byte b2 = 6;
        byte b3 = (byte) (b1+b2);

        System.out.println(2+2);    //  4
        System.out.println(2+'2');  // 2+50
        System.out.println('2'+'2');// 100
        System.out.println('2');    //2

        int a = '我';//看字符对应的码
        System.out.println(a);
        char b = 65;//看码对应的字符
        System.out.println(b);

        /*
        int a = 5;
        long b = a;
        int c = (int)b;//强制转

        long d = 5;  //自动转
        double e = 5;//自动转
        System.out.println(e);//5.0
        long f = 10000000000L;
        int g = (int)f;
        System.out.println(g);//1410065408 强转可能发生溢出

        double h = 25.9678;
        int i = (int)h;
        System.out.println(i);//25 强转丢精度

        int a2 = 999999999;
        char a1 = (char)a2;
        System.out.println(a1);
        char a3 = 65535;
        System.out.println(a3);

         */


        /*
        char a1 ='\\';
        char a2 = 'f';
        char a3 = ' ';
        char a4 = '女';
        char a5 = 65;
        char a6 = '\r';//回车
        System.out.println(a6);

         */

        /*
        //4)boolean:布尔型，一个字节
        boolean a = true;
        boolean b = false;

         */

        /*
        //3）浮点型，8个字节，大大大
        double a = 25.678;//默认为double
        float b =25.678F;
        double c = 3.0,d=2.9;
        System.out.println(c-d);


         */


        /*
        //2)长整型 8个字节
        long a = 25L;
        long b = 100000000000L;
        long d = 365L*24*60*60*1000;
        System.out.println(d);

        long e = 1000000000*2*10L;
        System.out.println(e);//200亿
        long f = 1000000000*3*10L
        System.out.println(f);//不是300亿
        long g = 1000000000L*3*10;
        System.out.println(g);//300亿


         */









    }

}
